import { ApiVersoin, ContentTypeEnum } from '@/common/enums/httpEnum'

const Url = {
  evaluateList: `${ApiVersoin.V3}/evaluate/list`,
  periodEvaluate: `${ApiVersoin.V4}/evaluate/get-period-evaluate`,
  submitCheckout: `${ApiVersoin.V4}/evaluate/submit-checkout`,
  getDetail: `${ApiVersoin.V4}/evaluate/get-detail`,
  checkoutEvaluate: `${ApiVersoin.V4}/evaluate/checkout-evaluate`,
  getNps: `${ApiVersoin.V4}/evaluate/get-nps`,
  postEvaluate: `${ApiVersoin.V4}/evaluate/post-period-evaluate`,
  postNps: `${ApiVersoin.V4}/evaluate/post-nps`,
  evaluateTags: `${ApiVersoin.V3}/evaluate/get-tags`,
  replyAll: `${ApiVersoin.V3}/evaluate/reply-all`,
  saveCleanEvaluate: `${ApiVersoin.V11}/clean/save-evaluate`,
  getCleanDetail: `${ApiVersoin.V11}/clean/detail`,
}

/*
 *服务评价列表
 */
//  { header: { 'Content-Type': ContentTypeEnum.JSON }
export const evaluateList = (params) => uni.$uv.http.get(Url.evaluateList, { params, custom: { showLoading: true } })
export const periodEvaluate = (params) => uni.$uv.http.get(Url.periodEvaluate, { params, custom: { showLoading: true } })
export const submitCheckout = (data) => uni.$uv.http.post(Url.submitCheckout, data, { header: { 'Content-Type': ContentTypeEnum.JSON }, custom: { showLoading: true } })
export const getDetail = (params) => uni.$uv.http.get(Url.getDetail, { params, custom: { showLoading: true } })
export const checkoutEvaluate = (params) => uni.$uv.http.get(Url.checkoutEvaluate, { params, custom: { showLoading: true } })
export const getNps = (data) => uni.$uv.http.post(Url.getNps, data, { custom: { showLoading: true } })
export const postEvaluate = (data) => uni.$uv.http.post(Url.postEvaluate, data, { custom: { showLoading: true } })
export const postNps = (data) => uni.$uv.http.post(Url.postNps, data, { header: { 'Content-Type': ContentTypeEnum.JSON }, custom: { showLoading: true } })
export const evaluateTags = (data) => uni.$uv.http.get(Url.evaluateTags, { data, custom: { showLoading: true } })
export const replyAll = (data) => uni.$uv.http.post(Url.replyAll, data, { custom: { showLoading: true } })

export const saveCleanEvaluate = (data) => uni.$uv.http.post(Url.saveCleanEvaluate, data, { custom: { showLoading: true } })

export const getCleanDetail = (data) => uni.$uv.http.get(Url.getCleanDetail, { data, custom: { showLoading: true } })
